<extend name="Base/ucenter"/>

<block name="style">
    <link href="__CSS__/usercenter.css" rel="stylesheet" type="text/css"/>
    <link href="__ZUI__/lib/datetimepicker/datetimepicker.css" rel="stylesheet" type="text/css">
</block>
<block name="header">
    <br/>
</block>
<block name="content">
    <script type="application/javascript">
        // 切换菜单
        active("stockpublish");
    </script>
    <form class="form-horizontal ajax-form" role="form" action="{:U('Product/Index/publish')}" method="post">
        <input type="hidden" name="cover" id="cover_id_cover" value="{$data.cover}"/>
        <input type="hidden" name="category" id="category" value="1"/>

        <div style="width: 150px;height: 150px;position: absolute;right: 100px">
            <img src="">
        </div>

        <div class="form-group has-feedback">
            <label for="title" class="col-xs-1 control-label">标题</label>

            <div class="col-xs-5">
                <input id="title" name="title" class="form-control form_check" check-type="Text" value="{$data.title}"
                       placeholder="标题"/>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="dead_line" class="col-xs-1 control-label">有效期</label>

            <div class="col-xs-5">
                <php>
                    if(isset($data['dead_line'])){
                    $data['dead_line']=date('Y-m-d H:i',$data['dead_line']);
                    }
                </php>
                <input id="dead_line" name="dead_line" class="time form-control form_check" value="{$data['dead_line']}"
                       placeholder="有效期(选填)"/>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="description" class="col-xs-1 control-label">摘要</label>

            <div class="col-xs-7">
                <textarea id="description" name="description" class="form-control" placeholder="简单描述一下资讯内容(选填)">{$data.description}</textarea>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="title" class="col-xs-1 control-label">材质</label>

            <div class="col-xs-5">
                <select id="material" name="material" class="form-control">
                    <volist name="material" id="top">
                        <option value="{$i}" <eq name="data['material']" value="$i"> selected</eq> >
                        {$top}
                        </option>
                    </volist>
                </select>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="title" class="col-xs-1 control-label">厚度</label>

            <div class="col-xs-5">
                <input id="thickness" name="thickness" class="form-control form_check" check-type="Text"
                       value="{$data.thickness}"
                       placeholder="厚度"/>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="title" class="col-xs-1 control-label">宽度</label>

            <div class="col-xs-5">
                <input id="width" name="width" class="form-control form_check" check-type="Text" value="{$data.width}"
                       placeholder="宽度"/>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="title" class="col-xs-1 control-label">硬度</label>

            <div class="col-xs-5">
                <input id="hardness" name="hardness" class="form-control form_check" check-type="Text" value="{$data.hardness}"
                       placeholder="硬度"/>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="title" class="col-xs-1 control-label">表面</label>

            <div class="col-xs-5">
                <select id="surface" name="surface" class="form-control">
                    <volist name="surface" id="top">
                        <option value="{$i}" <eq name="data['surface']" value="$i"> selected</eq> >
                        {$top}
                        </option>
                    </volist>
                </select>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="title" class="col-xs-1 control-label">产地</label>

            <div class="col-xs-5">
                <select id="madein" name="madein" class="form-control">
                    <volist name="madein" id="top">
                        <option value="{$i}" <eq name="data['madein']" value="$i"> selected</eq> >
                        {$top}
                        </option>
                    </volist>
                </select>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="title" class="col-xs-1 control-label">仓库</label>

            <div class="col-xs-5">
                <select id="warehouse" name="warehouse" class="form-control">
                    <volist name="warehouse" id="top">
                        <option value="{$i}"
                        <eq name="data['warehouse']" value="$i"> selected</eq>
                        >
                        {$top}
                        </option>
                    </volist>
                </select>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="title" class="col-xs-1 control-label">重量</label>

            <div class="col-xs-5">
                <input id="weight" name="weight" class="form-control form_check" check-type="Text" value="{$data.weight}"
                       placeholder="重量"/>
            </div>
        </div>

        <div class="form-group has-feedback">
            <label for="title" class="col-xs-1 control-label">数量</label>

            <div class="col-xs-5">
                <select id="quantity" name="quantity" class="form-control">
                    <volist name="quantity" id="top">
                        <option value="{$i}" <eq name="data['quantity']" value="$i"> selected</eq> >
                        {$top}
                        </option>
                    </volist>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="content" class="col-xs-1 control-label">详情</label>

            <div class="col-xs-10">
                <php>
                    $config="toolbars:[['source','|','bold','italic','underline','fontsize','forecolor','fontfamily','backcolor','|','link','emotion','scrawl','attachment','insertvideo','insertimage','insertcode']]";
                </php>
                </php>
                {:W('Common/Ueditor/editor',array('myeditor_edit','content',$data['detail']['content'],'700px','250px',$config))}
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-1 col-xs-1">
                <button type="submit" class="btn btn-primary " href="{:U('Event/Index/doPost')}">提交
                </button>

            </div>
            <div class="col-xs-8">
                <button onclick="history.go(-1);" class="btn btn-default " href="{:U('Event/Index/doPost')}">返回
                </button>
            </div>

        </div>
    </form>

    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <link href="__CORE_CSS__/form_check.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__CORE_JS__/form_check.js"></script>
    <script type="text/javascript" src="__ZUI__/lib/datetimepicker/datetimepicker.min.js"></script>
    <script>

        $('.time').datetimepicker({
            language: 'zh-CN',
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            minView: 0,
            forceParse: 0,
            format: 'yyyy-mm-dd hh:ii'
        });

        $('.time_d').datetimepicker({
            language: 'zh-CN',
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            minView: 2,
            forceParse: 0,
            format: 'yyyy-mm-dd'
        });
    </script>
</block>

